﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Sisocana.Core.Models.ONGModel>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    ONGS List
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery-1.5.1.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery-ui-1.8.11.js") %>" type="text/javascript"></script>
<link href="<%: Url.Content("~/Content/themes/base/jquery.ui.all.css") %>" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
    $(document).ready(function () {

        $("button, input:submit , input:file , p a").button();
    });
</script>
<h2>ONGS List</h2>
<script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery-1.5.1.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery-ui-1.8.11.js") %>" type="text/javascript"></script>
<link href="<%: Url.Content("~/Content/themes/base/jquery.ui.all.css") %>" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
    $(document).ready(function () {

        $("button, input:submit , input:file , p a").button();
    });
</script>
<p>
    <%: Html.ActionLink("Create New", "Create") %>
</p>
<% if (Model.Count() > 0){ %>
    <table>
        <tr>
            <th></th>
            <th>
                Name
            </th>
            <th>
                Description
            </th>
            <th>
                Web
            </th>
            <th>
                Status
            </th>

        </tr>

    <% foreach (var item in Model) { %>
        <tr>
            <td>
                <%--<%: Html.ActionLink("Edit", "Edit", new { id=item.id }) %> |
                <% if (item.estado == "A") { %>
                    <%: Html.ActionLink("Disable", "state", new { id = item.id })%> |
                <%} %>
                <% else{ %>
                    <%: Html.ActionLink("Enable", "state", new { id = item.id })%> |
                <%} %>--%>

                 <%= Html.MakeImgLink(Url.Action("Edit", "ONG", new { id = item.id }), "Edit", "edit.png")%> |
                <% if (item.estado == "A") { %>
                    <%= Html.MakeImgLink(Url.Action("state", "ONG", new { id = item.id }), "Disable", "delete.png")%>
                <%} %>
                <% else{ %>
                  <%= Html.MakeImgLink(Url.Action("state", "ONG", new { id = item.id }), "Enable", "delete.png")%>
                <%} %>

            </td>
            <td>
                <%: Html.DisplayFor(modelItem => item.nombre) %>
            </td>
            <td>
                <%= Html.Truncate(item.descripcion,100) %>
            </td>
            <td>
                <%: Html.DisplayFor(modelItem => item.urlGeneral) %>
            </td>
            <td>
                <% if (item.estado == "A") { %>
                    Active
                <%}  
                  else 
                  { %>                    
                    Inactive
                <%} %>
            </td>

        </tr>
    <% } %>

    </table>
<% } else {%>
    <p> Currently there is no ONG in the system</p>
<% } %>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeaderContent" runat="server">
</asp:Content>
